#include <stdio.h>

#define IN 1		/* inside a word */
#define OUT 0		/* outside a word */

/* copy input to output; 2nd version */

main ()
{
	int state;
	int c;
	int nl, nw, nc;

	nl = nw = nc = 0;
	state = OUT;

	while ( (c = getchar()) != EOF) { 

		//++nc;

		//if ( c == '\n') 
		//	++nl;

		if ( c != ' ' && c != '\t' && c != '\n') {
			state = IN;
			putchar(c);
		}
		else if ( state == IN) {
			state = OUT;
			printf("\n");
		}

		
	}

	//printf("%d %d %d \n", nl, nw, nc);

}
